package com.magenta.maxoptra.gis;

/**
 * User: stanislav.golovin
 * Date: 08.05.13
 * Time: 17:58
 */
public enum NokiaHereAttribute implements GISAccountProperty {
    UseProvider(GisParameter.use_map_provider, MapProviderType.nokiahere, GISFieldType.BOOLEAN, "false", true, 0L, true),
    NokiaHereTileServerUrlTpl(GisParameter.base_url, MapProviderType.nokiahere, GISFieldType.TEXT,
            "http://{s}.maps.nlp.nokia.com/maptile/2.1/maptile/newest/normal.day/{z}/{x}/{y}/256/png8?lg={lang}&app_id={appid}&token={token}", true, 1L, true),
    NokiaHereAPPID(GisParameter.map_id, MapProviderType.nokiahere, GISFieldType.TEXT,
            "YvxWYaFH39qLe5JOx7zv", true, 3L, true),
    NokiaHereToken(GisParameter.map_key, MapProviderType.nokiahere, GISFieldType.TEXT,
            "Uw8kbrT538rjIdEvWpJziA", true, 4L, true);

    NokiaHereAttribute(GisParameter parameter, MapProviderType providerType, GISFieldType type,
                       String defaultValue, boolean required, Long order, boolean important) {
        this(parameter.withProvider(providerType.name()),
                parameter.getLabel(),
                type,
                defaultValue,
                required,
                providerType.getLabel(),
                order, important);
    }

    NokiaHereAttribute(String name, String label, GISFieldType type, String defaultValue,
                       boolean required, String groupName, Long order, boolean important) {
        this.name = name;
        this.label = label;
        this.type = type;
        this.defaultValue = defaultValue;
        this.groupName = groupName;
        this.required = required;
        this.order = order;
        this.important = important;
    }

    private String name;
    private String label;
    private String tab = "GIS";
    private Long order;
    private GISFieldType type;
    private String defaultValue;
    private boolean required;
    private String groupName;
    private boolean important = true;

    @Override
    public String getName() {
        return name;
    }

    @Override
    public GISFieldType getType() {
        return type;
    }

    @Override
    public String getLabel() {
        return label;
    }

    @Override
    public Long getOrder() {
        return order;
    }

    @Override
    public Boolean getMandatory() {
        return required;
    }

    @Override
    public String getGroup() {
        return groupName;
    }

    @Override
    public String getTab() {
        return tab;
    }

    @Override
    public String getDefaultValue() {
        return defaultValue;
    }

    @Override
    public boolean isImportant() {
        return important;
    }

    @Override
    public boolean isReadOnly() {
        return false;
    }
}
